package socket2;

import java.io.IOException;
import java.net.Socket;

/**
 * @classname:ClientTest
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/21 19:33
 * @version: 0.1
 * @since:1.8
 */
public class ClientTest {
    public static void main(String[] args) {
        final String clientName = "client";
        try {
            Socket socket = new Socket("localhost", 7777);
            new Thread(() -> WriteOrReadMsg.readMsg(socket), clientName).start();
            new Thread(() -> WriteOrReadMsg.writeMsg(socket), clientName).start();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
